package com.cjb.basecouldprovider.provider.controller;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
public class ProviderController {

    @Autowired
    private DiscoveryClient discoveryClient;




    @GetMapping
    public Map<String,List<String>> map(){
        HashMap<String, List<String>> map = Maps.newHashMap();
        List<String> services = discoveryClient.getServices();
         map.put("当前服务提供者，提供的信息为：",services);
         map.put("", Lists.newArrayList("这是服务提供产生的数据","我是服务的提供方"));
        return map;
    }



}
